/**
 * 操作订单的一些公共操作
 */
define(['common/js/service/boss-common-service-0.1'],function(){
	   
	  serviceModule.factory("OrderCommonRestService", function ($window, $http, $q, CommonRestService) {
		  return {
			  
			  /***
			   * 查询购票记录,params:会员ID
			   */
			  getCustomerOrderHistory:function(params){
				  return CommonRestService.query("/common/order/getCustomerOrderHistory",params);
			  },
			  /***
	           * 查询销售渠道{goodSaleChannel,goodSaleChannelName}
	           */
	          getSaleChannel : function(requestParams){
				  return CommonRestService.query("/common/data/getSaleChannel",{});
			  },
			
			  /***
			   * 查询子渠道{key,value}
			   */
			  getChildChannel:function(requestParams){
				  return CommonRestService.query("/common/order/getChildChannel",requestParams);
			  },
			  /***
			   * 查询预订提醒
			   */
			  getAdvanceOrderAlert:function(params){
				  return CommonRestService.query("/common/order/getAdvanceOrderAlert",params);
			  },
			  /**
			   * 查询正式订单详情信息（用于打印凭证）
			   * @param requestParam
			   * @returns {*}
			   */
			  getPrintOrderDetail: function (requestParams) {
				  console.log(requestParams);
				  return CommonRestService.query('/common/order/getPrintOrderDetail',requestParams);
			  },
			  
			  /**
			   * 以下都是吕大侠写的
			   */
			  
			  /**
			   * 下单付款
			   */
			  payOrder : function(requestParams){
					return CommonRestService.query("/common/order/payOrder",requestParams,false);
			  },
			  /**
			   * 下单付款
			   */
			  createOrder : function(requestParams){
					return CommonRestService.query("/common/order/createOrder",requestParams,false);
			  },
			  /**
			   * 发送电子票
			   */
			  sendTicket : function(requestParams){
				  return CommonRestService.query("/common/order/sendTicket",requestParams,false);
			  },
			  /**
			   * 查询预订单的规则
			   */
			  findAdvanceRule:function(requestParams){
				  return CommonRestService.query("/common/order/findAdvanceRule",requestParams,false);
			  },
			  /**
			   * 查询预订单的商品信息
			   */
			  findAdvancePriceGoodList:function(requestParams){
				  return CommonRestService.query("/common/order/findAdvancePriceGoodList",requestParams,false);
			  },
			  /**
				 * 查询超级详情集合
				 */
			  findSuperDetailList:function(params){
				  return CommonRestService.query('/common/order/findSuperDetailList',params)
			  }
		  };
	  });
	  
	  /***
	  * 查询礼品卡
	  */
	  serviceModule.factory("OutletCardService",function($window, $http, $q,CommonRestService){
			return{

				/***
				 * 查询礼品卡余额
				 */
				findOrderCard:function(requestParams){
					console.log(requestParams);
					return CommonRestService.query('/common/outletcard/findOrderCard',requestParams);
				},

			};
		});
});